package edu.zut.cs.software.cms.module.all.clazz.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import edu.zut.cs.software.cms.base.domain.BaseEntity;

/**
 * This is a class entity. In java,class is a key word. So I decided to use
 * clazz instead.
 * 
 * @author 42276
 *
 */

@Entity
@Table(name = "T_CLAZZ")
public class Clazz extends BaseEntity<Long> {// BaseTreeEntity<Clazz,Long>{

	private static final long serialVersionUID = -4376674977047164142L;

	/**
	 * class ID
	 */
	// @Column//(name="CLASE_CODE")
	// @Column
	// String ID;

	/**
	 * class name such as Software Engineering 182
	 */
	@Column // (name="NAME")
	String name;

	/**
	 * the head teacher of the class
	 */
	@Column // (name="HEAD_TEACHER")
	String head_teacher;

	/**
	 * the number of students in the class
	 * 
	 */
	@Column // (name="NUMBER")
	String number;

	/**
	 * class's department such as 计算机学院
	 */
	@Column // (name="DEPARTMENT")
	String department;

	/**
	 * the major that the students in the class choose such as 软件工程
	 */
	@Column // (name="MAJOR")
	String major;

	//@ManyToOne(fetch = FetchType.LAZY, optional = false)
	@ManyToOne
	@JoinColumn(name = "CLAZZ_GRADE_ID")
	//@JsonIgnore
	Grade grade;

	public Grade getGrade() {
		return grade;
	}

	public void setGrade(Grade grade) {
		this.grade = grade;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getHead_teacher() {
		return head_teacher;
	}

	public void setHead_teacher(String head_teacher) {
		this.head_teacher = head_teacher;
	}

	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	public String getDepartment() {
		return department;
	}

	public void setDepartment(String department) {
		this.department = department;
	}

	public String getMajor() {
		return major;
	}

	public void setMajor(String major) {
		this.major = major;
	}

	// public String getID() {
	// return ID;
	// }

	// public void setID(String iD) {
	// ID = iD;
	// }

}
